![]() |
MPAllocateAligned |
||||
Header: | Multiprocessing.h | Carbon status: | Supported | |
Allocates a nonrelocatable memory block.
LogicalAddress MPAllocateAligned ( ByteCount size, UInt8 alignment, OptionBits options );
The size, in bytes, of the memory block to allocate.
The desired alignment of the allocated memory block. See
Any optional information to use with this call. See
A pointer to the allocated memory. If the function cannot allocate the requested memory or the requested alignment, the returned address is NULL.
The memory referenced by the returned address is guaranteed to be accessible by the application's cooperative task and any preemptive tasks that it creates, but not by other applications or their preemptive tasks. Any existing nonglobal heap blocks are freed when the application terminates. As with all shared memory, you must explicitly synchronize access to allocated heap blocks using a notification mechanism.
You can replicate the effect of the older MPAllocate function by calling MPAllocateAligned with 32-byte alignment and no options.
Also see the function MPFree.
Introduced with Multiprocessing Services 2.0.
Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 2.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 2.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)